package cn.qicaiwang.open.system.mapper;

import cn.qicaiwang.open.system.model.entity.SystemPost;
import cn.qicaiwang.open.system.model.req.SystemPostREQ;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * SystemPostMapper继承基类
 */
public interface SystemPostMapper extends BaseMapper<SystemPost> {
    Page<SystemPost> page(Page page, SystemPostREQ params);

    @Select("select * from system_post where del_flag = 1")
    Page<SystemPost> recyclebin(Page page);
    @Update("update system_post set del_flag = 0 where id = #{id}")
    int restore(String id);

    @Delete("delete from system_post where del_flag = 1")
    int clear();
}